
var sass = require("gulp-ruby-sass");
var gulp = require('gulp');
var minifycss = require('gulp-clean-css');
var connect = require('gulp-connect');
var uglify = require('gulp-uglify');
   
    
    
gulp.task('minifycss', function() {        //压缩css
    	gulp.src('scss/common.css').pipe(minifycss()) .pipe(gulp.dest('css/minicss')); 
    });
    
gulp.task('uglify', function() {           //压缩js
    	gulp.src('js/zuce02.js').pipe(uglify()) .pipe(gulp.dest('js/minijs')); 
    });
    


//定义一个任务，处理html
gulp.task("refreshHTML",function(){
     //src用来读取，pipe用来输送
     gulp.src("register.html").pipe(connect.reload());
});
//监听任务
gulp.task("watch",function (){
     //让connect启动一个服务器，这样它才能即时刷新浏览器
     connect.server({
          livereload:true
     });
     //检测文件的变化，执行相应的任务
     gulp.watch("register.html", ["refreshHTML"]);
});
